<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>addRawMaterial</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<style type="text/css">
<!--
.STYLE1 {font-size: 18px}
-->
</style>
</head>

<body>
<table width="877" height="53" border="0" cellspacing="0" align="center">
  <tr>
    <td width="8">&nbsp;</td>
    <td width="848"><div align="center">
      </p>
      <img src="../../image/logo.jpg" alt="logo" width="929" height="155" /></div></td>
    <td width="15">&nbsp;</td>
  </tr>
</table>
<table width="512" border="0" cellspacing="0" align="center">
  <tr>
    <th width="86" height="29" class="STYLE1" scope="row">about us </th>
    <th width="90" class="STYLE1" scope="row">products show </th>
    <th width="80" class="STYLE1" scope="row">company news </th>
    <td width="104" class="STYLE1"><strong>contact us </strong></td>
    <td width="142"><div align="center" class="STYLE1">
      <p><a href="../../manufacturer/view/ManufacturerViewLogin.php">User Login</a></p>
    </div></td>
  </tr>
</table>

<table width="975" border="0" cellspacing="0">
  <tr>
    <td width="164" rowspan="9"><table border="1"><td height="37" colspan="2" scope="row"><h2>Link List </h2></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><h3><strong>Stock</strong></h3></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><a href="../../Stock/view/StockViewList.php">Stock List</a><br />
            <a href="../../Stock/view/StockViewAdd.php">Add Stock</a></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><h3><strong>Raw Material<br />
    </strong></h3></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><a href="rawMaterialViewList.php">Raw Material list</a><a href="rawMaterialViewAdd.php"><br />
    Add Raw Material</a> <br /></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><h3><strong>Sale</strong>-Client</h3></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><a href="../../sale/client/view/clientViewList.php">Client List</a><br />
            <a href="../../sale/client/view/clientViewAdd.php">Add Client</a></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><h3>Sale-Merchandise
        </h3></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><a href="../../sale/merchandise/saleOut/view/merchandiseViewSaleOut.php">Merchandise-Sale out</a><br /><a href="../../sale/merchandise/saleOut/view/merchandiseViewSaleOut.php">Merchandise-Return</a> <br />
      <a href="../../sale/merchandise/saleOut/view/merchandiseViewList.php">Merchandise-List</a></td>
    </tr>
  <tr>
    <td colspan="2" scope="row"><h3>Sale-Order</h3></td>
    </tr>
  <tr>
    <td scope="row"><a href="../../sale/order/view/orderViewList.php">Order-List</a><br />
      <a href="../../sale/order/view/orderViewAdd.php">Order-Add</a>
  </table></td>
    <td width="807" rowspan="8"><!-- InstanceBeginEditable name="EditRegion3" -->
	 <?php 
	include ("../../Connections/SCMS.php");
   include ("../../Model/CheckClass.php");
   include ("../../Model/errorReportClass.php");
   include ("../../Model/databaseOperationClass.php");
	session_start();
   $Check = new CheckClass();
   $errReport = new errorReportClass();
   $databaseOperation = new databaseOperationClass();
	
	$manufacturer = $_SESSION['manufacturer'];
	if($manufacturer == NULL){
	$reportTo ="../../manufacturer/view/ManufacturerViewLogin.php";
       $errReport->errorReport(4, $reportTo);
       exit; 
	}
	
	$changeid = $_SESSION['changeid'];
   $query = "select * from rawmaterial where rid ='$changeid';";
	$sql = mysql_query($query) or die(mysql_error());
	$array = mysql_fetch_array($sql);
	$id = $array['rid'];
   $name = $array['rname'];
   $number = $array['rnumber'];
   $cost = $array['rcost'];
   $property = $array['rproperty'];
	$tockno = $array['rtockno'];

?>
      <p>Stock -&gt; Change Raw Material </p>
      <form id="form1" name="form1" method="post" action="../ucm/UCrawMaterialChange.php?id=<?php echo $id?>">
        <table width="439" height="155" border="1" align="center" cellspacing="0">
          <tr>
            <td width="149"><div align="right">Raw Material Id:</div></td>
            <td width="20"><?php echo $id ?></td>
            <td width="194">&nbsp;</td>
            <td width="58">&nbsp;</td>
          </tr>
          <tr>
            <td><div align="right">Raw Material Name:</div></td>
            <td><?php echo $name ?></td>
            <td><input type="text" name="name" /></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="right">Number:</div></td>
            <td><?php echo $number ?></td>
            <td><input type="text" name="number" /></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="right">Each Cost:</div></td>
            <td><?php echo $cost ?></td>
            <td><input type="text" name="cost" /></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="right">Property:</div></td>
            <td><?php echo $property ?></td>
            <td><textarea name="property"></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td><div align="right">Depot NO:</div></td>
            <td><?php echo $tockno ?></td>
            <td><input type="text" name="stockno" /></td>
            <td><input type="submit" name="Submit" value="Submit" /></td>
          </tr>
        </table>
      </form>
      <p>
        <?PHP
    $alret = new errorReportClass();
    $alertId = $_GET[id];

// alert for add Stock.
if ($alertId== 1){
   $alrentvalue = 'Success!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 2){
   $alrentvalue = 'Please Try again!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 3){
   $alrentvalue = 'Please Input Name!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 4){
   $alrentvalue = 'Please Input Number!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 5){
   $alrentvalue = 'Please Input Cost!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 6){
   $alrentvalue = 'Please Input Property!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 7){
   $alrentvalue = 'Please Input Stock NO!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 8){
   $alrentvalue = 'Stock NO need be a number!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 9){
   $alrentvalue = 'Number need be a number!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 10){
   $alrentvalue = 'Cost need be a 0.00!';
   $alret->alrent($alrentvalue);
}
else if ($alertId== 11){
   $alrentvalue = 'Name need be string!';
   $alret->alrent($alrentvalue);
}
 ?>
      </p>
      <p></p>
    <!-- InstanceEndEditable --></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <th scope="row">&nbsp;</th>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
